
<template>
  <div>
    <i-table :columns="columns" :list="list" :options="{isExpand:true}" ></i-table>
    <pagination v-show="total > 0" :total="total" :page.sync="pageParams.pageNum" :limit.sync="pageParams.pageSize"
                @pagination="getRemoteList"/>
  </div>
</template>

<script>
import { requestByUrl } from '@/utils/tools';

export default {
  name: "RomoteArrayView",
  props: {
    orderId: Number,
    element: Object,
    columns: Array
  },
  created() {
    this.getRemoteList()
  },
  data(){
    return {
      list:[],
      total:0,
      pageParams:{
        pageNum:1,
        pageSize:10
      }
    }
  },
  methods:{
    getRemoteList() {
      requestByUrl(this.element.url,'post',{
        page: this.pageParams.pageNum,
        limit: this.pageParams.pageSize,
        "_where": {
          order: this.orderId
        }
      }).then(res=>{
        this.list = res.data.lists
        this.total = res.data.query.total;
      })
    }
  }
}
</script>

<style scoped>

</style>
